<div id="main-content">
  <div class="container-fluid">
    <div class="row-fluid">
      <div class="span12">
        <div class="widget-block">
          <?php
          if($message == 'filed'){
          ?>
          <div class="alert alert-error fade in">
            <button data-dismiss="alert" class="close" type="button">×</button>
            <strong>Filed!</strong> Fail to save data.
          </div>
          <?php
          }
          if($message == 'sukses'){
          ?>
          <div class="alert alert-success fade in">
            <button data-dismiss="alert" class="close" type="button">×</button>
            <strong>Success!</strong> Now you have new user.
          </div>
          <?php
          }
          ?>
          <div class="widget-head">
            <h5><?=$title_table?></h5>
            <div class="widget-control pull-right">
              <a href="#" data-toggle="dropdown" class="btn dropdown-toggle"><i class="icon-cog"></i><b class="caret"></b></a>
              <ul class="dropdown-menu">
                <li><a href="<?=  site_url("menu/add-new") ?>"><i class="icon-plus"></i> Add New</a></li>
<!--                <li><a href="#"><i class="icon-ok"></i> Active</a></li>
                <li><a href="#"><i class="icon-minus-sign"></i> No-Active</a></li>
                <li><a href="#"><i class="black-icons pdf_document"></i> Export to PDF</a></li>-->
                <li><a href="<?=  site_url("menu/export-xls") ?>"><i class="black-icons excel_document"></i> Export to XLS</a></li>
              </ul>
            </div>
          </div>
          <div class="widget-content">
            <div class="widget-box">
              <table class="data-tbl-boxy table">
                <thead>
                  <tr>
                    <th>Name</th>
                    <th>Link</th>
                    <th>Parent</th>
                    <th>Option</th>
                  </tr>
                </thead>
                <tbody>
                  <?php
                  if(is_array($data)){
                    foreach ($data as $key => $value) {
                      $link_edit = site_url("menu/add-new/".$value->id_menu);
                      $link_delete = site_url("menu/delete/".$value->id_menu);
                      print <<<EOD
                  <tr>
                    <td>{$value->name}</td>
                    <td>{$value->link}</td>
                    <td>{$value->ayah}</td>
                    <td>
                      <div class="btn-group">
                        <button data-toggle="dropdown" class="btn btn-small dropdown-toggle">Action<span class="caret"></span></button>
                        <ul class="dropdown-menu">
                          <li><a href="{$link_edit}">Edit</a></li>
                          <li><a href="{$link_delete}">Delete</a></li>
                        </ul>
                      </div>
                    </td>
                  </tr>
EOD;
                    }
                  }
                  ?>
                </tbody>
              </table>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</div>